ALMaSS  1.0
The Animal, Landscape and Man Simulation System
Hare_Infant Class Reference

Class for infant hares (stationary, only milk inputs) More...

#include <hare_all.h>

Inheritance diagram for Hare_Infant:
THare TAnimal TALMaSSObject Hare_Young

Public Member Functions

virtual void BeginStep (void)
 BeginStep for the Hare_Infant. More...
 
virtual void Step (void)
 Step for the Hare_Infant. More...
 
virtual void EndStep (void)
 EndStep for the Hare_Infant. More...
 
 Hare_Infant (int p_x, int p_y, Landscape *p_L, THare_Population_Manager *p_PPM)
 Hare infant constructor. More...
 
void ReInit (struct_Hare a_data)
 Infant object reinitiation. More...
 
void Init ()
 Object initiation. More...
 
virtual ~Hare_Infant ()
 Hare infant destructor. More...
 
virtual void ON_Dead ()
 This hare has been killed. More...
 
void ON_BeingFed (double a_someMilk)
 Get energy from milk given. More...
 
void SetWeight (double w)
 Set the weight. More...
 
void SetMum (Hare_Female *a_af)
 Set the mother pointer. More...
 
- Public Member Functions inherited from THare
 THare (int p_x, int p_y, Landscape *p_L, THare_Population_Manager *p_PPM)
 Constructor. More...
 
void THareInit (int p_x, int p_y, THare_Population_Manager *p_PPM)
 Object Initiation. More...
 
virtual ~THare ()
 Destructor. More...
 
virtual TTypeOfHareState st_Dispersal ()
 Base implementation only - reimplemented. More...
 
double GetWeight ()
 
double GetTotalWeight ()
 Provide the wet weight of the hare. More...
 
int GetAge ()
 
void ON_MumDead (Hare_Female *a_Mum)
 Inform Mum that we are dead. More...
 
void SetMum (Hare_Female *)
 Set the mother pointer. Reimplemented in Hare_Infant. More...
 
Hare_FemaleGetMum ()
 Get the mother pointer. More...
 
double GetRMR ()
 Get todays RMR. More...
 
virtual bool WasPredated ()
 Test for predation. More...
 
int GetRefNum ()
 Get the refnum for this hare. More...
 
void loadVegPalatability (void)
 Loads static member m_vegPalatability with data. More...
 
- Public Member Functions inherited from TAnimal
unsigned SupplyFarmOwnerRef ()
 
AnimalPosition SupplyPosition ()
 
APoint SupplyPoint ()
 
int SupplyPolygonRef ()
 
int Supply_m_Location_x ()
 
int Supply_m_Location_y ()
 
virtual void KillThis ()
 
virtual void CopyMyself ()
 
void SetX (int a_x)
 
void SetY (int a_y)
 
 TAnimal (int x, int y, Landscape *L)
 
virtual void ReinitialiseObject (int x, int y, Landscape *L)
 Used to re-use an object - must be implemented in descendent classes. More...
 
virtual int WhatState ()
 
virtual void Dying ()
 
void CheckManagement (void)
 
void CheckManagementXY (int x, int y)
 
- Public Member Functions inherited from TALMaSSObject
int GetCurrentStateNo ()
 Returns the current state number. More...
 
void SetCurrentStateNo (int a_num)
 Sets the current state number. More...
 
bool GetStepDone ()
 Returns the step done indicator flag. More...
 
void SetStepDone (bool a_bool)
 Sets the step done indicator flag. More...
 
virtual void ReinitialiseObject ()
 Used to re-use an object - must be implemented in descendent classes. More...
 
 TALMaSSObject ()
 The constructor for TALMaSSObject. More...
 
virtual ~TALMaSSObject ()
 The destructor for TALMaSSObject. More...
 
void OnArrayBoundsError ()
 Used for debugging only, tests basic object properties. More...
 

Protected Member Functions

TTypeOfHareState st_Developing ()
 Developmental behaviour for the infant hare. More...
 
void st_NextStage ()
 'mature' to become a young More...
 
bool OnFarmEvent (FarmToDo event)
 Do we require a response to a farm event. More...
 
- Protected Member Functions inherited from THare
bool Run (int a_dist, int a_direction)
 Run a distance in a direction. More...
 
void EnergyBalance (TTypeOfActivity a_activity, int dist)
 Adjust energy balance for an activity. More...
 
void TimeBudget (TTypeOfActivity a_activity, int dist)
 Adjust time budger for an activity. More...
 
void st_Dying ()
 Tidy up before removing the object on death. More...
 
virtual void Running (int a_max_dist)
 Run. More...
 
void Walking (int a_dist, int a_direction)
 Walking. More...
 
double Forage (int &time)
 Foraging. More...
 
double ForageP (int &time)
 Foraging but also incorporating pesticide exposure. More...
 
virtual void InternalPesticideHandlingAndResponse ()
 Handles internal effects of pesticide exposure. If any effects are needed this method must be re-implemented by descendent classes. More...
 
virtual void GeneralEndocrineDisruptor (double)
 Handles internal effects of endocrine distrupter pesticide exposure. If any effects are needed this method must be re-implemented by descendent classes. More...
 
virtual void GeneralOrganoPhosphate (double)
 Handles internal effects of organophosphate pesticide exposure. If any effects are needed this method must be re-implemented by descendent classes. More...
 
double ForageSquare (int a_x, int a_y)
 Forage from an area. More...
 
double ForageSquareP (int a_x, int a_y, double *a_pestexposure)
 Forage from an area and resturn pesticide exposure as well as food. More...
 
int GetPegDistance ()
 Get peg distance. More...
 
int GetPegPull ()
 Get attractive force of peg. More...
 
int GetPegDirection ()
 Get direction of peg. More...
 
void MovePeg ()
 Move the peg according to attraction forces. More...
 
- Protected Member Functions inherited from TAnimal
void CorrectWrapRound ()
 Corrects wrap around co-ordinate problems. More...
 

Additional Inherited Members

- Static Public Attributes inherited from THare
static double * m_vegPalatability = NULL
 Will hold and array of palatability for hare for each tov type. Most are 1, but unpalatable vegetation can be specified here. More...
 
- Protected Attributes inherited from THare
TTypeOfHareState m_CurrentHState
 Defines the current activity. More...
 
int m_Age
 State variale - hare age. More...
 
Hare_Object m_Type
 State variale - the type of hare. More...
 
double m_weight
 State variale - hare weight g. More...
 
double m_old_weight
 State variale - last hare weight. More...
 
Hare_Femalem_MyMum
 Pointer to the hare's mum. More...
 
THare_Population_Managerm_OurPopulationManager
 Pointer to the hare population manager. More...
 
int m_Lifespan
 Physiolocal lifespan, assuming nothing else kills the hare (unlikely to reach this age) More...
 
int m_ActivityTime
 Minutes of potential activity time per day. More...
 
int m_StarvationDays
 State variable - the number of consecutive days in negative energy balance. More...
 
double m_fatReserve
 State variable - the energy reserve of the hare. More...
 
double m_TodaysEnergy
 State variable - the amount of energy available today, can be in deficit. More...
 
double m_EnergyMax
 State variable - the amount of energy it is possible to eat as a multiplyer or RMR. More...
 
double m_KJRunning
 KJ/m cost of running per kg hare. More...
 
double m_KJWalking
 KJ/m cost of walking per kg hare. More...
 
double m_KJForaging
 KJ/m cost of foraging per kg hare. More...
 
double m_SpeedRunning
 m/min speed of running per kg hare More...
 
double m_SpeedWalking
 m/min speed of walking per kg hare More...
 
double m_foragingenergy
 Energy obtained from foraging/feeding. More...
 
int m_peg_x
 peg x-coordinate More...
 
int m_peg_y
 peg y-coordinate More...
 
int m_RefNum
 Unique hare reference number, also functions as sex flag. More...
 
int m_experiencedDensity
 State variable used in alternative density-dependent configurations. More...
 
int m_lastYearsDensity
 State variable used in alternative density-dependent configurations. More...
 
int m_ddindex
 State variable used in alternative density-dependent configurations. More...
 
int m_expDensity [365]
 State variable used in alternative density-dependent configurations. More...
 
int m_DensitySum
 State variable used in alternative density-dependent configurations. More...
 
bool m_IamSick
 flag for sickness - used in conjunction with disease configurations More...
 
double m_pesticide_burden
 State variable used to hold the current body-burden of pesticide. More...
 
double m_pesticidedegradationrate
 State variable used to hold the daily degredation rate of the pesticide in the body. More...
 
bool m_pesticideInfluenced1
 Flag to indicate pesticide effects (e.g. can be used for endocrine distruptors with delayed effects until birth). More...
 
- Protected Attributes inherited from TAnimal
int m_Location_x
 
int m_Location_y
 
Landscapem_OurLandscape
 
- Protected Attributes inherited from TALMaSSObject
int m_CurrentStateNo
 The basic state number for all objects - '-1' indicates death. More...
 
bool m_StepDone
 Indicates whether the iterative step code is done for this timestep. More...
 

Detailed Description

Class for infant hares (stationary, only milk inputs)

Constructor & Destructor Documentation

◆ Hare_Infant()

Hare_Infant::Hare_Infant ( int  p_x,
int  p_y,
Landscape p_L,
THare_Population_Manager p_PPM 
)

Hare infant constructor.

1272  : THare(p_x,p_y,p_L,p_PPM)
1273 {
1274  Init();
1275 }
void Init()
Object initiation.
Definition: Hare_all.cpp:1285
THare(int p_x, int p_y, Landscape *p_L, THare_Population_Manager *p_PPM)
Constructor.
Definition: Hare_THare.cpp:66

References Init().

◆ ~Hare_Infant()

Hare_Infant::~Hare_Infant ( )
virtual

Hare infant destructor.

1296 {
1297  //Nothing to do
1298 }

Member Function Documentation

◆ BeginStep()

void Hare_Infant::BeginStep ( void  )
virtual

BeginStep for the Hare_Infant.

Tests for mortality. Both standard mortality tests and optional density dependent mortality. NB this differs from all other ALMaSS models in that the farm events do not have any direct impact on any hare stage except this one. I assume that all other stages can run away - seems not to cause a problem with fitting to Illumø

Reimplemented from THare.

Reimplemented in Hare_Young.

1309 {
1310  if (m_CurrentStateNo == -1) return;
1311  // These are all the same value - this may change to so I have kept all three
1312  // for now ver 00005
1316  m_ActivityTime=1440; // Start the day
1318 #ifdef __DDEPMORT
1320 #ifdef __THRESHOLD_DD
1321  if (dens<m_OurPopulationManager->m_HareThresholdDD) dens=0;
1322 #endif
1323  double inter=m_OurPopulationManager->GetInterference(dens);
1324  if (g_rand_uni() > inter) {
1325  ON_Dead();
1326  m_StepDone=true; // We need to skip the step code, we are dead
1327  return;
1328  }
1329 #endif
1331  ON_Dead();
1332  m_StepDone=true; // We need to skip the step code, we are dead
1333  }
1334 
1335  if (m_MyMum==NULL) {
1336  ON_Dead();
1337  m_StepDone=true; // We need to skip the step code, we are dead
1338  }
1339  // Set out maximum intake possible
1340  CheckManagement();
1341 }
boost::variate_generator< base_generator_type &, boost::uniform_real<> > g_rand_uni
virtual void ON_Dead()
This hare has been killed.
Definition: Hare_all.cpp:1688
bool m_StepDone
Indicates whether the iterative step code is done for this timestep.
Definition: PopulationManager.h:118
int m_CurrentStateNo
The basic state number for all objects - '-1' indicates death.
Definition: PopulationManager.h:116
int m_Location_y
Definition: PopulationManager.h:228
int m_Location_x
Definition: PopulationManager.h:225
void CheckManagement(void)
Definition: PopulationManager.cpp:1404
int GetTotalDensity(int x, int y)
Density function - returns the density of all hares in the square containing by x,...
Definition: hare_all.h:676
double m_YoungMortRate
Input variable - Young mortality rate.
Definition: hare_all.h:738
double GetKJperM(int a_size)
Get the cost of moving 1m in KJ dependent upon mass (.
Definition: hare_all.h:626
double GetInterference(int h)
Return the proportion of time used in communicating with con-specifics.
Definition: hare_all.h:700
double m_KJForaging
KJ/m cost of foraging per kg hare.
Definition: hare_all.h:238
double m_old_weight
State variale - last hare weight.
Definition: hare_all.h:185
Hare_Female * m_MyMum
Pointer to the hare's mum.
Definition: hare_all.h:190
int m_ActivityTime
Minutes of potential activity time per day.
Definition: hare_all.h:203
double m_KJWalking
KJ/m cost of walking per kg hare.
Definition: hare_all.h:233
double m_weight
State variale - hare weight g.
Definition: hare_all.h:180
double m_KJRunning
KJ/m cost of running per kg hare.
Definition: hare_all.h:228
THare_Population_Manager * m_OurPopulationManager
Pointer to the hare population manager.
Definition: hare_all.h:194

References TAnimal::CheckManagement(), g_rand_uni, THare_Population_Manager::GetInterference(), THare_Population_Manager::GetKJperM(), THare_Population_Manager::GetTotalDensity(), THare::m_ActivityTime, TALMaSSObject::m_CurrentStateNo, THare::m_KJForaging, THare::m_KJRunning, THare::m_KJWalking, TAnimal::m_Location_x, TAnimal::m_Location_y, THare::m_MyMum, THare::m_old_weight, THare::m_OurPopulationManager, TALMaSSObject::m_StepDone, THare::m_weight, THare_Population_Manager::m_YoungMortRate, and ON_Dead().

◆ EndStep()

void Hare_Infant::EndStep ( void  )
virtual

EndStep for the Hare_Infant.

Reimplemented from THare.

Reimplemented in Hare_Young.

1391 {
1393  // Legal returns are:
1394  // tohs_Developing
1395  // tohs_NextStage
1396  // tohs_Dying
1398  }
1399  if (m_CurrentHState==tohs_Dying) {
1400  ON_Dead();
1401  } else MovePeg();
1402 }
TTypeOfHareState st_Developing()
Developmental behaviour for the infant hare.
Definition: Hare_all.cpp:1615
void MovePeg()
Move the peg according to attraction forces.
Definition: HareForagenPeg.cpp:527
TTypeOfHareState m_CurrentHState
Defines the current activity.
Definition: hare_all.h:165
@ tohs_Developing
Definition: hare_all.h:73
@ tohs_Dying
Definition: hare_all.h:79

References THare::m_CurrentHState, THare::MovePeg(), ON_Dead(), st_Developing(), tohs_Developing, and tohs_Dying.

◆ Init()

void Hare_Infant::Init ( void  )

Object initiation.

1286 {
1287  m_Type = hob_Infant;
1288  m_weight = -1; // just so we know we must set this somewhere else
1289  m_old_weight = 0;
1290  m_Age = 1; // We are 0 day old today
1291 }
Hare_Object m_Type
State variale - the type of hare.
Definition: hare_all.h:175
int m_Age
State variale - hare age.
Definition: hare_all.h:170
@ hob_Infant
Definition: hare_all.h:57

References hob_Infant, THare::m_Age, THare::m_old_weight, THare::m_Type, and THare::m_weight.

Referenced by Hare_Infant(), Hare_Young::Hare_Young(), ReInit(), and Hare_Young::ReInit().

◆ ON_BeingFed()

void Hare_Infant::ON_BeingFed ( double  a_someMilk)

Get energy from milk given.

The conversion efficiency is pre-calcualted in GetgperKJ so this function is quite simply a conversion from KJ to g
NOTE There are no limits here - the limit to growth has to be by the limited amount of milk supplied - the ultimate limit to this has got to be defined somewhere else (e.g. female forage).

1699 {
1704  m_TodaysEnergy+=a_someMilk;
1705 }
double m_TodaysEnergy
State variable - the amount of energy available today, can be in deficit.
Definition: hare_all.h:218

References THare::m_TodaysEnergy.

Referenced by Hare_Female::DoLactation().

◆ ON_Dead()

void Hare_Infant::ON_Dead ( void  )
virtual

This hare has been killed.

Do the housekeeping necessary before dying

Reimplemented from THare.

Reimplemented in Hare_Young.

1689 {
1690  st_Dying();
1691 }
void st_Dying()
Tidy up before removing the object on death.
Definition: Hare_THare.cpp:172

References THare::st_Dying().

Referenced by BeginStep(), EndStep(), and OnFarmEvent().

◆ OnFarmEvent()

bool Hare_Infant::OnFarmEvent ( FarmToDo  event)
protectedvirtual

Do we require a response to a farm event.

Checks to see if any nasty farm event has caused the death of the infant.
Currently there is only one response to those events where death is possible. However, this may not always be the case so the code is structured as for the other ALMaSS animals (i.e. it could be a bit easier to overview if it were written differently).

Reimplemented from THare.

Reimplemented in Hare_Young.

1409 {
1410  bool result=false;
1411  switch ( event )
1412  {
1413  case sleep_all_day:
1414  case glyphosate:
1415  break;
1416  case autumn_plough:
1417  if ( random( 100 ) < cfg_hare_i_cut.value() ) result=true;
1418  break;
1419  case stubble_plough:
1420  if (random(100) < cfg_hare_i_cut.value()) result = true;
1421  break;
1423  if (random(100) < cfg_hare_i_cut.value()) result = true;
1424  break;
1426  if (random(100) < cfg_hare_i_cut.value()) result = true;
1427  break;
1428  case autumn_harrow:
1429  if ( random( 100 ) < cfg_hare_i_cut.value() ) result=true;
1430  break;
1431  case preseeding_cultivator:
1432  if (random(100) < cfg_hare_i_cut.value()) result = true;
1433  break;
1435  if (random(100) < cfg_hare_i_cut.value()) result = true;
1436  break;
1437  case autumn_roll:
1438  if ( random( 100 ) < cfg_hare_i_cut.value() ) result=true;
1439  break;
1440  case autumn_sow:
1441  if ( random( 100 ) < cfg_hare_i_cut.value() ) result=true;
1442  break;
1443  case winter_plough:
1444  if ( random( 100 ) < cfg_hare_i_cut.value() ) result=true;
1445  break;
1446  case deep_ploughing:
1447  if ( random( 100 ) < cfg_hare_i_cut.value() ) result=true;
1448  break;
1449  case spring_plough:
1450  if ( random( 100 ) < cfg_hare_i_cut.value() ) result=true;
1451  break;
1452  case spring_harrow:
1453  if ( random( 100 ) < cfg_hare_i_cut.value() ) result=true;
1454  break;
1455  case shallow_harrow:
1456  if (random(100) < cfg_hare_i_cut.value()) result = true;
1457  break;
1458  case spring_roll:
1459  if ( random( 100 ) < cfg_hare_i_cut.value() ) result=true;
1460  break;
1461  case spring_sow:
1462  if ( random( 100 ) < cfg_hare_i_cut.value() ) result=true;
1463  break;
1464  case spring_sow_with_ferti:
1465  if (random(100) < cfg_hare_i_cut.value()) result = true;
1466  break;
1467  case fp_npks:
1468  break;
1469  case fp_npk:
1470  break;
1471  case fp_pk:
1472  break;
1473  case fp_liquidNH3:
1474  break;
1475  case fp_slurry:
1476  break;
1477  case fp_ammoniumsulphate:
1478  break;
1479  case fp_manganesesulphate:
1480  break;
1481  case fp_manure:
1482  break;
1483  case fp_greenmanure:
1484  if ( random( 100 ) < cfg_hare_i_cut.value() ) result=true;
1485  break;
1486  case fp_sludge:
1487  break;
1488  case fp_rsm:
1489  break;
1490  case fp_calcium:
1491  break;
1492  case fa_npks:
1493  break;
1494  case fa_npk:
1495  break;
1496  case fa_pk:
1497  break;
1498  case fa_slurry:
1499  break;
1500  case fa_ammoniumsulphate:
1501  break;
1502  case fa_manganesesulphate:
1503  break;
1504  case fa_manure:
1505  break;
1506  case fa_greenmanure:
1507  break;
1508  case fa_sludge:
1509  break;
1510  case fa_rsm:
1511  break;
1512  case fa_calcium:
1513  break;
1514  case herbicide_treat:
1515  break;
1516  case growth_regulator:
1517  break;
1518  case fungicide_treat:
1519  break;
1521  case trial_toxiccontrol:
1522  case trial_control:
1523  case syninsecticide_treat:
1524  case insecticide_treat:
1525  case product_treat:
1526  case biocide:
1527  break;
1528  case molluscicide:
1529  break;
1530  case row_cultivation:
1531  break;
1532  case strigling:
1533  if ( random( 100 ) < cfg_hare_i_cut.value() ) result=true;
1534  break;
1535  case strigling_hill:
1536  if (random(100) < cfg_hare_i_cut.value()) result = true;
1537  break;
1538  case hilling_up:
1539  break;
1540  case water:
1541  break;
1542  case swathing:
1543  if ( random( 100 ) < cfg_hare_i_cut.value() ) result=true;
1544  break;
1545  case harvest:
1546  if ( random( 100 ) < cfg_hare_i_cut.value() ) result=true;
1547  break;
1548  case cattle_out:
1549  break;
1550  case cattle_out_low:
1551  break;
1552  case cut_to_hay:
1553  if ( random( 100 ) < cfg_hare_i_cut.value() ) result=true;
1554  break;
1555  case cut_to_silage:
1556  if ( random( 100 ) < cfg_hare_i_cut.value() ) result=true;
1557  break;
1558  case straw_chopping:
1559  if ( random( 100 ) < cfg_hare_i_cut.value() ) result=true;
1560  break;
1561  case hay_turning:
1562  if ( random( 100 ) < cfg_hare_i_cut.value() ) result=true;
1563  break;
1564  case hay_bailing:
1565  if ( random( 100 ) < cfg_hare_i_cut.value() ) result=true;
1566  break;
1567 
1568  case stubble_harrowing:
1569  break;
1571  if ( random( 100 ) < cfg_hare_i_cut.value() ) result=true;
1572  break;
1573  case burn_straw_stubble:
1574  if ( random( 100 ) < cfg_hare_i_cut.value() ) result=true;
1575  break;
1576  case mow:
1577  if ( random( 100 ) < cfg_hare_i_cut.value() ) result=true;
1578  break;
1579  case cut_weeds:
1580  if ( random( 100 ) < cfg_hare_i_cut.value() ) result=true;
1581  break;
1582  case pigs_out:
1583  result=true;
1584  break;
1585  case strigling_sow:
1586  if ( random( 100 ) < cfg_hare_i_cut.value() ) result=true;
1587  break;
1588  case bed_forming:
1589  if (random(100) < cfg_hare_i_cut.value()) result = true;
1590  break;
1591  case flower_cutting:
1592  if (random(100) < cfg_hare_i_cut.value()) result = true;
1593  break;
1594  case bulb_harvest:
1595  if (random(100) < cfg_hare_i_cut.value()) result = true;
1596  break;
1597  case straw_covering:
1598  break;
1599  case straw_removal:
1600  break;
1601  default:
1602  m_OurLandscape->Warn( "Hare_Infant::OnFarmEvent(): Unknown event type:", m_OurLandscape->EventtypeToString( event ) );
1603  exit( 1 );
1604  }
1605  if (result) {
1606  ON_Dead();
1607  }
1608  return result;
1609 }
int random(int a_range)
Definition: ALMaSS_CmdLine.cpp:142
CfgInt cfg_hare_i_cut("HARE_CUTTING_MORT_INFANT", CFG_CUSTOM, 50)
int value(void)
Definition: configurator.h:98
std::string EventtypeToString(int a_event)
Definition: Landscape.cpp:3918
void Warn(std::string a_msg1, std::string a_msg2)
Definition: landscape.h:1579
Landscape * m_OurLandscape
Definition: PopulationManager.h:229
@ burn_straw_stubble
Definition: treatment.h:92
@ autumn_harrow
Definition: treatment.h:37
@ swathing
Definition: treatment.h:81
@ fa_pk
Definition: treatment.h:62
@ winter_plough
Definition: treatment.h:42
@ strigling
Definition: treatment.h:77
@ shallow_harrow
Definition: treatment.h:107
@ straw_removal
Definition: treatment.h:112
@ fp_npks
Definition: treatment.h:48
@ glyphosate
Definition: treatment.h:102
@ fa_sludge
Definition: treatment.h:68
@ fp_liquidNH3
Definition: treatment.h:51
@ spring_roll
Definition: treatment.h:46
@ fa_greenmanure
Definition: treatment.h:67
@ spring_plough
Definition: treatment.h:44
@ fa_rsm
Definition: treatment.h:69
@ molluscicide
Definition: treatment.h:75
@ syninsecticide_treat
Definition: treatment.h:99
@ hay_turning
Definition: treatment.h:88
@ fa_manganesesulphate
Definition: treatment.h:64
@ autumn_roll
Definition: treatment.h:38
@ fp_manure
Definition: treatment.h:55
@ bed_forming
Definition: treatment.h:106
@ deep_ploughing
Definition: treatment.h:43
@ pigs_out
Definition: treatment.h:84
@ fa_npk
Definition: treatment.h:61
@ herbicide_treat
Definition: treatment.h:71
@ row_cultivation
Definition: treatment.h:76
@ heavy_cultivator_aggregate
Definition: treatment.h:108
@ spring_sow
Definition: treatment.h:47
@ fungicide_treat
Definition: treatment.h:73
@ fp_manganesesulphate
Definition: treatment.h:53
@ harvest
Definition: treatment.h:82
@ biocide
Definition: treatment.h:104
@ cut_to_silage
Definition: treatment.h:86
@ sleep_all_day
Definition: treatment.h:33
@ mow
Definition: treatment.h:93
@ preseeding_cultivator
Definition: treatment.h:39
@ fa_ammoniumsulphate
Definition: treatment.h:65
@ autumn_plough
Definition: treatment.h:34
@ straw_chopping
Definition: treatment.h:87
@ fa_manure
Definition: treatment.h:66
@ fp_greenmanure
Definition: treatment.h:56
@ fa_slurry
Definition: treatment.h:63
@ preseeding_cultivator_sow
Definition: treatment.h:40
@ product_treat
Definition: treatment.h:101
@ stubble_harrowing
Definition: treatment.h:90
@ hilling_up
Definition: treatment.h:79
@ straw_covering
Definition: treatment.h:111
@ growth_regulator
Definition: treatment.h:72
@ fp_ammoniumsulphate
Definition: treatment.h:54
@ trial_control
Definition: treatment.h:98
@ fp_rsm
Definition: treatment.h:58
@ stubble_cultivator_heavy
Definition: treatment.h:36
@ insecticide_treat
Definition: treatment.h:74
@ trial_insecticidetreat
Definition: treatment.h:96
@ cattle_out_low
Definition: treatment.h:100
@ cut_to_hay
Definition: treatment.h:85
@ cut_weeds
Definition: treatment.h:94
@ bulb_harvest
Definition: treatment.h:110
@ spring_sow_with_ferti
Definition: treatment.h:103
@ strigling_hill
Definition: treatment.h:105
@ fp_sludge
Definition: treatment.h:57
@ autumn_sow
Definition: treatment.h:41
@ fa_calcium
Definition: treatment.h:70
@ fp_npk
Definition: treatment.h:49
@ fp_pk
Definition: treatment.h:50
@ trial_toxiccontrol
Definition: treatment.h:97
@ hay_bailing
Definition: treatment.h:89
@ spring_harrow
Definition: treatment.h:45
@ strigling_sow
Definition: treatment.h:95
@ stubble_plough
Definition: treatment.h:35
@ cattle_out
Definition: treatment.h:83
@ flower_cutting
Definition: treatment.h:109
@ fp_slurry
Definition: treatment.h:52
@ water
Definition: treatment.h:80
@ fa_npks
Definition: treatment.h:60
@ fp_calcium
Definition: treatment.h:59
@ autumn_or_spring_plough
Definition: treatment.h:91

References autumn_harrow, autumn_or_spring_plough, autumn_plough, autumn_roll, autumn_sow, bed_forming, biocide, bulb_harvest, burn_straw_stubble, cattle_out, cattle_out_low, cfg_hare_i_cut, cut_to_hay, cut_to_silage, cut_weeds, deep_ploughing, Landscape::EventtypeToString(), fa_ammoniumsulphate, fa_calcium, fa_greenmanure, fa_manganesesulphate, fa_manure, fa_npk, fa_npks, fa_pk, fa_rsm, fa_sludge, fa_slurry, flower_cutting, fp_ammoniumsulphate, fp_calcium, fp_greenmanure, fp_liquidNH3, fp_manganesesulphate, fp_manure, fp_npk, fp_npks, fp_pk, fp_rsm, fp_sludge, fp_slurry, fungicide_treat, glyphosate, growth_regulator, harvest, hay_bailing, hay_turning, heavy_cultivator_aggregate, herbicide_treat, hilling_up, insecticide_treat, TAnimal::m_OurLandscape, molluscicide, mow, ON_Dead(), pigs_out, preseeding_cultivator, preseeding_cultivator_sow, product_treat, random(), row_cultivation, shallow_harrow, sleep_all_day, spring_harrow, spring_plough, spring_roll, spring_sow, spring_sow_with_ferti, straw_chopping, straw_covering, straw_removal, strigling, strigling_hill, strigling_sow, stubble_cultivator_heavy, stubble_harrowing, stubble_plough, swathing, syninsecticide_treat, trial_control, trial_insecticidetreat, trial_toxiccontrol, CfgInt::value(), Landscape::Warn(), water, and winter_plough.

◆ ReInit()

void Hare_Infant::ReInit ( struct_Hare  a_data)

Infant object reinitiation.

1277 {
1278  m_Location_x = a_data.x;
1279  m_Location_y = a_data.y;
1280  m_OurLandscape = a_data.L;
1281  m_CurrentStateNo = 0;
1282  THareInit(a_data.x, a_data.y, a_data.HM);
1283  Init();
1284 }
void THareInit(int p_x, int p_y, THare_Population_Manager *p_PPM)
Object Initiation.
Definition: Hare_THare.cpp:72
int y
Definition: hare_all.h:138
int x
Definition: hare_all.h:137
Landscape * L
Definition: hare_all.h:140
THare_Population_Manager * HM
Definition: hare_all.h:141

References struct_Hare::HM, Init(), struct_Hare::L, TALMaSSObject::m_CurrentStateNo, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, THare::THareInit(), struct_Hare::x, and struct_Hare::y.

Referenced by THare_Population_Manager::CreateObjects().

◆ SetMum()

void Hare_Infant::SetMum ( Hare_Female a_af)
inline

Set the mother pointer.

856 { m_MyMum=a_af; }

References THare::m_MyMum.

Referenced by THare_Population_Manager::CreateObjects().

◆ SetWeight()

void Hare_Infant::SetWeight ( double  w)
inline

Set the weight.

This is only used when a hare is born, so no need to have it in the base class

851 { m_weight=w; }

References THare::m_weight.

Referenced by THare_Population_Manager::CreateObjects().

◆ st_Developing()

TTypeOfHareState Hare_Infant::st_Developing ( )
protected

Developmental behaviour for the infant hare.

This code must be called by the EndStep.
To do this we need to add growth and energy requirements. The idea is to grow immediately on milk supply - handled via ON_someMilk()but if there are any other adjustments to be made they ought to be done here, e.g. if energy is needed for movement or thermoregululation. The easiest way to manage things is to use weight as a measure of energy, and convert freely between the two. This means that conversion efficiencies need to be applied to the energy inputs (done in on_BeingFed)

First remove our BMR

Make sure m_TodaysEnergy is zero before we run the risk of getting milk from Mum again during Step tomorrow.

If all is well then mature to become a Hare_Young

1616 {
1622  //int weight=(int) (floor(m_weight+0.5));
1623  double lost = m_OurPopulationManager->GetRMR(m_Age,GetTotalWeight()); // Uses age, weight and ambient temperature
1625  //** Then grow if possible, or shrink if -ve energy
1626  double gained=(m_TodaysEnergy-lost);
1628  m_weight+=gained*eff;
1629 
1630  // We need to know whether the growth rate is positive or negative.
1631  // We could look at lost here, but it is probably easier to use the same
1632  // approach for Young as well, and they need the oldweight variable, so might as well use this.
1633 #ifdef __MINGROWTHATTAIN
1634  // Take a check on our growth - if we are below X% of the max expected weight then die
1635  if (m_weight< m_OurPopulationManager->m_DMWeight[m_Age]) return tohs_Dying;
1636 #else
1637  if (m_weight<m_old_weight) {
1638  m_StarvationDays++;
1639  }
1640  else m_StarvationDays=0;
1645  return tohs_Dying;
1646  }
1647 #endif
1648 
1650  m_TodaysEnergy=0;
1652  if (++m_Age>10) return tohs_NextStage;
1653  return tohs_Developing;
1654 }
static CfgInt cfg_infant_starvation_threshold("HARE_INFANT_STARVE_THRESHOLD", CFG_CUSTOM, 4)
double GetRMR(int a_age, double a_size)
Returns the RMR given a specific age and mass.
Definition: Hare_all.cpp:1034
double GetGrowthEfficiency(int a_age)
Get the growth efficiency for this a_age.
Definition: hare_all.h:590
double GetMaxDailyGrowthEnergyP(int a_age)
Get the maximum daily energy needed for growth for this a_age for use in protein construction.
Definition: hare_all.h:565
double GetTotalWeight()
Provide the wet weight of the hare.
Definition: hare_all.h:370
int m_StarvationDays
State variable - the number of consecutive days in negative energy balance.
Definition: hare_all.h:208
@ tohs_NextStage
Definition: hare_all.h:72

References cfg_infant_starvation_threshold, THare_Population_Manager::GetGrowthEfficiency(), THare_Population_Manager::GetMaxDailyGrowthEnergyP(), THare_Population_Manager::GetRMR(), THare::GetTotalWeight(), THare::m_Age, THare::m_old_weight, THare::m_OurPopulationManager, THare::m_StarvationDays, THare::m_TodaysEnergy, THare::m_weight, tohs_Developing, tohs_Dying, tohs_NextStage, and CfgInt::value().

Referenced by EndStep().

◆ st_NextStage()

void Hare_Infant::st_NextStage ( )
protected

'mature' to become a young

This creats a Hare_Young object via a call to create objects then sets the flag for destruction of this object.

1660 {
1664  struct_Hare* sp;
1665  sp = new struct_Hare;
1666  sp->HM = m_OurPopulationManager;
1667  sp->L = m_OurLandscape;
1668  sp->x = m_Location_x;
1669  sp->y = m_Location_y;
1670  sp->weight = m_weight;
1671  sp->age = m_Age;
1672  // Updating of Mum is done through the population manager
1673  sp->Mum = m_MyMum;
1674  // *** Debug ***
1675  //sp->oldMum = m_MyOldMum;
1676  //
1677  m_OurPopulationManager->CreateObjects(1,this,NULL,sp,1);
1678  // Clean-up
1679  m_CurrentStateNo=-1; // Destroys the object at the next opportunity
1681  m_MyMum=NULL;
1682  delete sp;
1683 }
void CreateObjects(int ob_type, TAnimal *pvo, void *null, struct_Hare *data, int number)
Method used to create new hares.
Definition: Hare_all.cpp:928
Class used to pass hare information to CreateObjects.
Definition: hare_all.h:135
double weight
Definition: hare_all.h:144
int age
Definition: hare_all.h:139
Hare_Female * Mum
Definition: hare_all.h:142
@ tohs_DestroyObject
Definition: hare_all.h:80

References struct_Hare::age, THare_Population_Manager::CreateObjects(), struct_Hare::HM, struct_Hare::L, THare::m_Age, THare::m_CurrentHState, TALMaSSObject::m_CurrentStateNo, TAnimal::m_Location_x, TAnimal::m_Location_y, THare::m_MyMum, TAnimal::m_OurLandscape, THare::m_OurPopulationManager, THare::m_weight, struct_Hare::Mum, tohs_DestroyObject, struct_Hare::weight, struct_Hare::x, and struct_Hare::y.

Referenced by Step().

◆ Step()

void Hare_Infant::Step ( void  )
virtual

Step for the Hare_Infant.

The step code is the main activity sub-stepfor each time-step. A dead animal will have m_CurrentStateNo set to -1 It is essential that before an animal is killed that it has sent all the necessary messages to others (in this case to its mother).

m_CurrentHState holds the current behavioural state

Reimplemented from THare.

Reimplemented in Hare_Young.

1356 {
1357  if (m_StepDone || m_CurrentStateNo == -1) return;
1358  // The next line causes a jump to the correct behavioural state
1359  switch (m_CurrentHState)
1360  {
1361  case tohs_InitialState: // Initial state
1363  break;
1364  case tohs_Developing:
1365  m_StepDone=true;
1366  break;
1367  case tohs_NextStage:
1368  // Legal returns are:
1369  // NONE
1370  st_NextStage();
1371  m_StepDone=true;
1372  break;
1373  case tohs_Running:
1375  break;
1376  case tohs_Dying:
1377  m_StepDone=true;
1378  break;
1379  default:
1380  m_OurLandscape->Warn("Hare_Infant::Step - unknown state",NULL);
1381  exit(1);
1382  }
1383 }
void st_NextStage()
'mature' to become a young
Definition: Hare_all.cpp:1659
@ tohs_InitialState
Definition: hare_all.h:71
@ tohs_Running
Definition: hare_all.h:78

References THare::m_CurrentHState, TALMaSSObject::m_CurrentStateNo, TAnimal::m_OurLandscape, TALMaSSObject::m_StepDone, st_NextStage(), tohs_Developing, tohs_Dying, tohs_InitialState, tohs_NextStage, tohs_Running, and Landscape::Warn().


The documentation for this class was generated from the following files: